Setting up VS code is easy. Just follow this link and pick the version for your machine. Once the installer is downloaded,
run it and follow the instructions.
When you open vs code, you should see this screen:
You might not need to do this bit. If you haven’t used ssh in a previous class, you’ll very likely need to change your password
here due to not having any password set for the class.
When you set the password, make sure the drop down circled in blue is set to yes.
Make note of the text circled in red. That’s part of the address of the server you’ll use.
Open vs code and click Terminal -> New Terminal then just enter into the terminal
ssh cs15lsp22aaa@ieng6.ucsd.edu
but make sure to replace aaa with whatever combination of letters is there on your global password reset page. You’ll be prompted for your password. Once you enter it, you should get the following output:
You’re now connected to the server, and any UNIX commands you run will be run on the server rather than your pc. You can use the exit
command at any time to log off the server.
Play around in the server with UNIX commands. Here’s a list of commands you can try
ls
prints the files and directories in the currnet directoryls -a
same as above but prints a wider range of things such as .ssh and .config directoriescd
moves to the listed directory in the current file, or to the parent directory if none is specified.mkdir <name>
creates a new directory in the current one of the specified nametouch <name>
creates a file of the specified name.
The server’s not worth much to us if we can’t run our own programs on it. To do that we use scp
to send files we write on our own computers over to the server.
The format for an scp command is simply ‘scp
You can also send it to a specific directory in the server by putting `cs15lsp22aaa@ieng6.ucsd.edu:~` and insert the filepath after the '~'
Here's an example of me using scp to move the example.txt file from my own pc to the server.
![Image](https://rhankin214.github.io/cse15l-lab-reports/scp_example_1.png)
As you can see, it's now in the main directory of the server. If it was a java file, I could now compile and run it with the javac and java commands.
The way we just did that worked, but it was very inefficient. To run a java file on the server that way, we have to
ssh-keygen
generate a key that will let the server recognize our computer so we don’t have to enter our password every time.
Here’s some screen shots depicting the whole process
cd
We’ve cutout the passwords, but running a file on the server still takes multiple commands. We have two techniques we can use to make multiple commands into one.